package teamGiga.action;

import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import teamGiga.bean.MovieBean;
import teamGiga.bean.TheaterBean;
import teamGiga.bean.TheaterRoomBean;
import teamGiga.dao.MovieDao;
import action.servlet.ActionForWard;

public class AddShowingAction extends Action{
	private String path;
	private boolean redirect;
	public AddShowingAction(String path, boolean redirect) {
		super();
		this.path = path;
		this.redirect = redirect;
	}
	public AddShowingAction() {
		super();
	}
	@Override
	public ActionForWard execute(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		try {
			List<TheaterBean> tbean =MovieDao.getT();
			request.setAttribute("tbean", tbean);
			HashMap<Object, Object>mlist=new HashMap<Object, Object>();
			List<TheaterRoomBean> trbean=MovieDao.getTr(mlist);
			request.setAttribute("trbean", trbean);
			List<MovieBean>mbean=MovieDao.getMovie();
			request.setAttribute("mbean", mbean);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return new ActionForWard(path, redirect);
	}
}
